package com.zhuoyue.biz.core.api.service;

import com.zhuoyue.biz.core.api.domain.Group;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zhuoyue.biz.core.api.domain.GroupDeviceRelation;
import com.zhuoyue.biz.core.api.dto.rep.GroupRepDTO;
import com.zhuoyue.biz.core.api.dto.req.ControlReq;

import java.text.ParseException;
import java.util.List;
import java.util.Map;

/**
 * @author wjming
 * @ClassName: GroupService
 * @Description:
 * @Date 2021-07-14 20:19
 */
public interface GroupService extends IService<Group> {
    /**
     * 创建群组关系
     *
     * @param deviceId
     * @param group
     * @param type
     */
    void createGroupDeviceRelation(List<String> deviceId, Group group, String type);

    /**
     * 删除群组和配置信息
     *
     * @param group
     * @throws InterruptedException
     */
    void deleteGroupAndGroupSet(Group group) throws InterruptedException;

    /**
     * 发送且添加群组信息
     *
     * @param add
     * @param addList
     * @throws InterruptedException
     */
    void sendAddCmd(String add, String addList) throws InterruptedException;

    /**
     * 删除群组信息
     *
     * @param clear
     * @param clearList
     * @throws InterruptedException
     */
    void sendClearCmd(String clear, String clearList) throws InterruptedException;

    /**
     * 查询群组信息
     *
     * @param gatewayMac
     * @return
     */
    List<GroupRepDTO> selectByGroups(String gatewayMac);

    /**
     * 查询群组的配置信息
     *
     * @param groupId
     * @return
     */
    GroupRepDTO selectGroupsDetailsById(String groupId);

    /**
     * 控制
     *
     * @param group
     * @param mode
     * @param delayTime
     * @param duration
     * @param brightness
     * @param colorTemperature
     * @param modeIndex
     * @throws ParseException
     */
    void deviceControl(Group group, String mode, Integer delayTime, Integer duration, Integer brightness, Integer colorTemperature, Integer modeIndex) throws ParseException;

    /**
     * 群组控制
     *
     * @param group
     * @param controlReq
     * @throws ParseException
     */
    void deviceControl(Group group, ControlReq controlReq) throws ParseException;

    /**
     * 删除单个设备信息
     *
     * @param groupDeviceRelation
     */
    void deleteGroupAndDeviceRelation(GroupDeviceRelation groupDeviceRelation);
}

